<?php
namespace app\index\controller;

use think\facade\Request;

class Index extends Base
{
    public function index()
    {
        // 获取轮播图数据
        $carousel = $this->logic()->carousel()->lists();
        $this->assign('carousel', $carousel['list']);
//        $_POST['type'] = 'time';
//        $_POST['type_value'] = 'id desc';
//        \request()->type = 'time';
//        \request()->type_value = 'id desc';
//        \request()->curr = 1;
//        \request()->limit = 15;
//        $article = controller('Article')->tableHandle();
//        $json = json_encode($article);
//        $article = json_decode($json, true);
//        var_dump($article);
////        $article = json_decode("{$article}", true);
//        $article = $article['data']['append'];
//        $this->assign('article', $article);
        return $this->fetch();
    }

    public function hello()
    {
//        $rt = $this->logic()->article()->tableMonth();
//        var_dump($rt);
//        $rt = $this->logic()->article()->category();
//        var_dump($rt);
        $rt = $this->logic()->articleSort()->getCategoryAllNum([]);
        var_dump($rt);
//        $rt = $this->logic()->articleSort()->getAllSubIds(1,true);
//        var_dump($rt);
//        $rt = $this->logic()->tag()->getHotTag();
//        var_dump($rt);
//        echo strtotime(date(1980.'-'.05));
    }

    public function read()
    {
        return view();
    }

    public function cs()
    {
        $bool = is_file('../../../text.txt');
        var_dump($bool);
    }

}
